package cn.kc.jdbc.controller;

import cn.kc.jdbc.entity.Score;
import cn.kc.jdbc.service.ScoreService;
import cn.kc.jdbc.service.ScoreServiceImpl;

import java.util.List;

/**
 * @author mosin
 * date 2022/2/14
 * @version 1.0
 * 成绩控制层
 */
public class ScoreController {

    private ScoreService scoreService = new ScoreServiceImpl();

    //记录成绩

    public Boolean addScore(String stuName,String courseName,Double score){

        Boolean b =   scoreService.addScore(stuName,courseName,score);

        return  b;
    }

    //查询指定科目的所有学生的成绩
    public List<Score> findScoreByCourseName(String CourseName){
        List<Score>  scores = scoreService.findAllScore(CourseName);
        return   scores;
    }



}
